package com.wxh.swagger3.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.*;

/**
 * @ClassName: Person
 * @Description: 个人信息类
 * @Author wxh
 * @Date: 2020/7/17 10:33
 * @Version V1.0.0
 * @Since 1.8
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "个人信息")
public class Person {

    @ApiModelProperty(value = "主键ID")
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "姓名")
    @Size(max = 20)
    private String name;

    @ApiModelProperty(value = "年龄")
    @Max(150)
    @Min(1)
    private Integer age;

    @ApiModelProperty(value = "地址")
    @NotNull
    private String address;

    @ApiModelProperty(value = "邮箱")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")
    private String email;


}
